package com.fhz.kotlin1904a

import android.content.Context
import android.widget.Toast

/**
 * 时间:2021/10/12
 * @author msfeng
 */

fun String.toast(context:Context){
    Toast.makeText(context,this,Toast.LENGTH_SHORT).show()
}

fun Number.toast(context:Context){
    Toast.makeText(context,"$this",Toast.LENGTH_SHORT).show()
}

fun MutableList<Int>.swap(index1: Int, index2: Int) {
    val tmp = this[index1] // “this”对应该列表
    this[index1] = this[index2]
    this[index2] = tmp
}



